/**
 * 
 */
package three_star_craft.uap.state;


/**
 * State map for UAP generators. Map contains all available states as 
 * static instances
 * 
 * @author w.antosiewic
 */
public class UapStateMap
{
	private static UapStateMap _instance;
	
	/**
	 * Initial state of generator
	 */
	public static UapStateIdle UAP_IDLE;

	/**
	 * Message UapConnectionReq has been send and generator is waiting
	 * for reply
	 */
	public static UapStateConnectPend UAP_CONNECT_PEND;
	
	/**
	 * UapGenerator has established signaling connection with SGW
	 */
	public static UapStateConnected UAP_CONNECTED;
	
	/**
	 * UapGenerator has initiated release of signaling connection
	 */
	public static UapStateDisconnectPend UAP_DISCONNECT_PEND;
	
	/**
	 * UapGenerator has initiated setup of media bearer towards
	 * Media Gateway
	 */
	public static UapStateMediaBearerSetupPend UAP_MEDIA_BEARER_SETUP_PEND;
	
	/**
	 * Returns singleton instance of state map
	 * @return the UapStateMap
	 */
	public static UapStateMap instance()
	{
		if(_instance == null)
		{
			_instance = new UapStateMap();
		}
		return _instance;
	}
	
	private UapStateMap()
	{
		UAP_IDLE = UapStateIdle.getInstance();
		UAP_CONNECT_PEND = UapStateConnectPend.getInstance();
		UAP_CONNECTED = UapStateConnected.getInstance();
		UAP_DISCONNECT_PEND = UapStateDisconnectPend.getInstance();
		UAP_MEDIA_BEARER_SETUP_PEND = UapStateMediaBearerSetupPend.getInstance();
	}

	/**
	 * Returns starting state for every UapGenerator
	 * @return starting state instance
	 * @see three_star_craft.uap.state.UapStateIdle
	 */
	public UapStateBase startState()
	{
		return UAP_IDLE;
	}
	
}
